<!DOCTYPE doctype PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

<HTML>
  <HEAD>
    <META name="generator" content=
    "HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">

    <TITLE>Clear Code Bytes</TITLE>
    <META http-equiv="content-type" content="text/html; charset=windows-1252">
    <LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
  </HEAD>

  <BODY>
    <H1><A name="Clear_Code_Bytes"></A>Clear</H1>

    <H2>Clear Code Bytes</H2>

    <BLOCKQUOTE>
      <P>Clear Code Bytes reverts <A href=
      "help/topics/DisassemblerPlugin/Disassembly.htm">disassembled</A> instructions and <A href=
      "help/topics/DataPlugin/Data.htm">defined data</A> to their undefined state. It can also be
      used to clear the components of an applied structure directly from the browser.<BR>
      </P>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>To Clear a single instruction,</P>

      <BLOCKQUOTE>
        <OL type="1">
          <LI>Position the cursor on a defined instruction or data code unit</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear Code
          Bytes</I><BR>
          Alternately: press the 'C' key</LI>
        </OL>
      </BLOCKQUOTE>

      <P>To Clear an area,</P>

      <BLOCKQUOTE>
        <OL type="1">
          <LI>Select the defined code units (data and instructions)</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear Code
          Bytes</I><BR>
          Alternately: press the 'C' key</LI>
        </OL>
      </BLOCKQUOTE>

      <P>To Clear components of a structure directly in the browser,</P>

      <BLOCKQUOTE>
        <OL type="1">
          <LI>Select the structure elements in the open structure</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear Code
          Bytes</I><BR>
          Alternately: press the 'C' key</LI>

          <LI style="list-style: none"><BR>
          </LI>
        </OL>
      </BLOCKQUOTE>

      <P><IMG alt="" src="help/shared/note.png" x-maintain-ratio="TRUE" border="0"> Clearing bytes
      inside a structure from the CodeBrowser, changes the definition of the structure and will
      affect all occurences of the structure.</P>
    </BLOCKQUOTE>

    <H2><A name="Clear_With_Options"></A>Clear With Options</H2>

    <BLOCKQUOTE>
      <P><I>Clear With Options</I> more selectively clears information defined in the program.
      While <I>Clear Code Bytes</I> only clears instructions and data, Clear With
      Options can selectively choose either instructions or data and additionally can remove
      other program information, e.g., symbols, references, functions, etc.</P>

      <P>The <I>Clear</I> dialog has check boxes for each type of information that can be cleared.
      If the check box is selected, that item will be removed everywhere within the selection when
      the OK button is pressed.</P>
    </BLOCKQUOTE>

    <DIV style="text-align: center;">
      <IMG alt="" src="images/ClearWithOptions.png"><BR>
    </DIV>

    <BLOCKQUOTE>
      <P>To Clear With Options,</P>

      <DIV style="margin-left: 2em">
        <OL>
          <LI>Create a selection in the Code Browser containing instruction and/or defined data to
          be cleared.</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear With
          Options...</I></LI>

          <LI>De-selected the check boxes from the items that should not be cleared.</LI>

          <LI>Click <I>OK</I>.</LI>
        </OL>
      </DIV>

      <BLOCKQUOTE>
        <P><I><IMG alt="" src="help/shared/note.png" x-maintain-ratio="TRUE" border="0"></I> You
        can undo clearing of code units if it has an undesired effect.</P>
      </BLOCKQUOTE>
    </BLOCKQUOTE>

    <BLOCKQUOTE>
      <P>The following paragraphs describe each option.</P>

      <H3>Symbols</H3>

      <BLOCKQUOTE>
        <P>Any User defined <A href="help/topics/SymbolTablePlugin/symbol_table.htm">symbol</A> in
        the program. Automatically generated symbols won't be cleared if references still exist to
        the symbol's defined address.</P>

        <BLOCKQUOTE>
          <P><IMG alt="" src="help/shared/note.png" x-maintain-ratio="TRUE" border="0"> This option
          will <B>not</B> clear function names. To delete these you must select the <A href=
          "#functions">functions</A> option.</P>
        </BLOCKQUOTE>
      </BLOCKQUOTE>

      <H3>Comments</H3>

      <BLOCKQUOTE>
        <P>Clears Pre, Post, End of Line (EOL), Plate <A href=
        "help/topics/CommentsPlugin/Comments.htm">comments</A>. It will not clear comments on
        functions or function variables.</P>

        <BLOCKQUOTE>
          <P><IMG alt="" src="help/shared/note.png" x-maintain-ratio="TRUE" border="0"> This option
          will <B>not</B> clear repeatable or automatic comments. To delete those comments you must
          delete the associated reference.</P>
        </BLOCKQUOTE>
      </BLOCKQUOTE>

      <H3>Properties</H3>

      <BLOCKQUOTE>
        <P>Properties are placed at addresses in a program by plugins to store information. This
        information is usually only understood by the plugin that placed it there or other
        cooperating plugins.</P>

        <P><IMG alt="" src="help/shared/tip.png" border="0"> Select the <A href=
        "help/topics/PropertyManagerPlugin/Property_Viewer.htm">properties</A> icon (<IMG alt=""
        src="images/document-properties.png" border="0"> ) on the tool bar to display all the
        properties that are currently in the program.</P>
      </BLOCKQUOTE>

      <H3>Instructions</H3>

      <BLOCKQUOTE>
        <P>Instructions are cleared.</P>
      </BLOCKQUOTE>

      <H3>Data</H3>

      <BLOCKQUOTE>
        <P>Defined Data elements are cleared.</P>
      </BLOCKQUOTE>

      <H3>User-defined References</H3>

      <BLOCKQUOTE>
        <P>Any references added by the user are cleared.</P>
      </BLOCKQUOTE>

      <H3>Analysis References</H3>

      <BLOCKQUOTE>
        <P>Any references created by analysis tasks are cleared.</P>
      </BLOCKQUOTE>

      <H3>Import References</H3>

      <BLOCKQUOTE>
        <P>Any references created during the import process are cleared, such as calls to external
        library functions.</P>
      </BLOCKQUOTE>

      <H3>Default References</H3>

      <BLOCKQUOTE>
        <P>References automatically created by Ghidra during disassembly are cleared. This includes
        references to stack variables within the body of a function.</P>
      </BLOCKQUOTE>

      <H3><A name="functions">Functions</A></H3>

      <BLOCKQUOTE>
        <P>Defined functions are cleared, including comments and any defined variables. Any
        references to stack variables within the body of the function will be cleared as well.</P>
      </BLOCKQUOTE>

      <H3>Registers</H3>

      <BLOCKQUOTE>
        <P>Registers within the selection with a defined value will be cleared and set to
        undefined. Registers can be set to a value using Set Register Values.</P>
      </BLOCKQUOTE>

      <H3>Equates</H3>

      <BLOCKQUOTE>
        <P>Instructions with Scalar Operands set to display an alternate string with an <A href=
        "help/topics/EquatePlugin/Equates.htm">Equate</A> are cleared.</P>
      </BLOCKQUOTE>

      <H3>Bookmarks</H3>

      <BLOCKQUOTE>
        <P>All types of <A href="help/topics/BookmarkPlugin/Bookmarks.htm">Bookmarks</A> are
        cleared.<BR>
        </P>
      </BLOCKQUOTE>
    </BLOCKQUOTE>

    <H2><A name="Clear_Flow_and_Repair"></A>Clear Flow and Repair</H2>

    <BLOCKQUOTE>
      <P><I>Clear Flow and Repair</I> is intended to be used to clear and optionally repair code
      which was produced in error. The duration of this action will vary depending on the extent of
      the instruction flow. If good code with extensive flow is encountered, the action may take a
      long time to complete. If the flow analysis is lengthy, a task dialog will be displayed with
      a <I>Cancel</I> button. The <I>Cancel</I> button may be pressed to terminate the action.</P>

      <BLOCKQUOTE>
        <P><IMG src="help/shared/note.png" alt="Note" border="0"> You can undo clearing of code
        units if it has an undesired effect</P>
      </BLOCKQUOTE>

      <P>The <I>Clear Flow</I> options dialog has check boxes to control its behavior. Pressing the
      <I>OK</I> button will begin the clear process using the selected options.</P>
    </BLOCKQUOTE>

    <TABLE x-use-null-cells="" width="100%">
      <TBODY>
        <TR>
          <TD align="center" width="100%"><IMG src="images/ClearFlow.png" alt=""><BR>
          </TD>
        </TR>
      </TBODY>
    </TABLE>

    <BLOCKQUOTE>
      <P>To Clear instructions produced by an invalid fall-through or bad code produced by a data
      reference:</P>

      <DIV style="margin-left: 2em">
        <OL>
          <LI>Click on the first bad instruction</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear Flow
          and Repair...</I></LI>

          <LI>Choose the desired <I>Clear Flow Options</I>.</LI>

          <LI>Click <I>OK</I>.</LI>
        </OL>
      </DIV>

      <P>To Clear instructions referenced by one or more pointers :</P>

      <DIV style="margin-left: 2em">
        <OL>
          <LI>Select all pointer data units</LI>

          <LI>From the right-mouse pop-up menu over the Code Browser window, select <I>Clear Flow
          and Repair...</I></LI>

          <LI>Choose the desired <I>Clear Flow Options</I>.</LI>

          <LI>Click <I>OK</I>.</LI>
        </OL>
      </DIV>

      <P>Note that clearing pointer referenced code will also clear all computed flow references to
      the address(es) referenced by the selected pointer(s).<BR>
      </P>

      <P>The following paragraphs describe each option.</P>

      <H3>Clear Symbols</H3>

      <BLOCKQUOTE>
        <P>All non-default <A href="help/topics/SymbolTablePlugin/symbol_table.htm">symbols</A> at
        cleared code unit locations will be removed.<BR>
        </P>
      </BLOCKQUOTE>

      <H3>Clear Data</H3>

      <BLOCKQUOTE>
        <P>All data whoose only references were from cleared code unit locations will also be
        cleared.</P>
      </BLOCKQUOTE>

      <H3>Repair</H3>

      <BLOCKQUOTE>
        <P>Following the clearing of the flow, attempt to repair the disassembly of references into
        the cleared region.</P>
      </BLOCKQUOTE>
    </BLOCKQUOTE>

    <P class="providedbyplugin"><BR>
    Provided By: <I>ClearPlugin</I></P>

    <P class="relatedtopic">Related Topics:</P>

    <UL>
      <LI><A href="help/topics/DisassemblerPlugin/Disassembly.htm">Disassembly</A></LI>

      <LI><A href="help/topics/ImporterPlugin/importer.htm">Importing Files</A></LI>

      <LI><A href="help/topics/PropertyManagerPlugin/Property_Viewer.htm">Property Viewer</A></LI>
    </UL><BR>
    <BR>
    <BR>
    <BR>
  </BODY>
</HTML>
